//
// Created by hanweiguang on 2019-02-18.
// Copyright (c) 2019 hanweiguang. All rights reserved.
//

#import "TestCell.h"
#import "View+MASShorthandAdditions.h"

@implementation TestCell {

}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(nullable NSString *)reuseIdentifier {


    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
        [self settingViewAutoLayout];
    }
    return self;
}


#pragma mark  创建view

- (void)createView {


    self.title = [[UILabel alloc] init];
    self.title.text = @"积分商城";
    [self.contentView addSubview:self.title];

    self.imageTop = [[UIImageView alloc] init];
    NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"image_aa" ofType:@"png"];
    self.imageTop.image = [UIImage imageWithContentsOfFile:imagePath];
    [self.contentView addSubview:self.imageTop];


}


- (void)settingViewAutoLayout {


    [self.imageTop mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.and.left.mas_equalTo(self.contentView).offset(10);
        make.width.equalTo(ScreenW/3);
        make.height.equalTo(50);

    }];


    [self.title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.imageTop.bottom);
        make.centerX.equalTo(self.imageTop.centerX);
        make.bottom.equalTo(self.contentView.bottom);


    }];


}


- (void)config:(id)item {



}
@end